//
//  LSZMoreTopicsTableViewCell.m
//  JKFuYinProject
//
//  Created by 九酷 on 2018/8/24.
//  Copyright © 2018年 LC. All rights reserved.
//

#import "LSZMoreTopicsTableViewCell.h"

@implementation LSZMoreTopicsTableViewCell
-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        CGFloat height = [LSZSpecialPackaging initWithReturnsthesizeOf:78 :4];
        self.imageViewIcon = [[UIImageView alloc]init];
        self.imageViewIcon.frame = CGRectMake(20,20, height-40, height-40);
        [self addSubview:self.imageViewIcon];

        CGFloat heightTitle = [LSZSpecialPackaging initWithReturnsthesizeOf:25 :2];
        self.labelTitle = [[UILabel alloc]init];
        self.labelTitle.frame = CGRectMake(height, 15, ScreenWidth/2, heightTitle);
        self.labelTitle.textColor = titleColorLSZ;
        [LSZSpecialPackaging setLabelAdaptiveSize:self.labelTitle font:18];
        [self addSubview:self.labelTitle];

        CGFloat heightExplain = [LSZSpecialPackaging initWithReturnsthesizeOf:18 :2];
        self.labelExplain = [[UILabel alloc]init];
        self.labelExplain.textColor = lightColor;
        [LSZSpecialPackaging setLabelAdaptiveSize:self.labelExplain font:13.5];
        self.labelExplain.frame = CGRectMake(CGRectGetMinX(self.labelTitle.frame), CGRectGetMaxY(self.labelTitle.frame)+5, ScreenWidth-CGRectGetMinX(self.labelTitle.frame)-10,heightExplain);
        [self addSubview:self.labelExplain];

    }
    return self;
}
-(void)setDynamicClassificationMg:(LSZDynamicClassificationMg *)dynamicClassificationMg
{
    if (dynamicClassificationMg.logo_more.count >0) {
        if (ScreenWidth <= 375) {
            NSString *decodeString = [dynamicClassificationMg.logo_more[0] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
            [self.imageViewIcon sd_setImageWithURL:[NSURL URLWithString:decodeString] placeholderImage:[UIImage imageNamed:@"placeholder"]];
        }else {
            NSString *decodeString = [dynamicClassificationMg.logo_more[1] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
            [self.imageViewIcon sd_setImageWithURL:[NSURL URLWithString:decodeString] placeholderImage:[UIImage imageNamed:@"placeholder"]];
        }
    }else{
        self.imageViewIcon.image = [UIImage imageNamed:@"placeholder"];
    }
    self.labelTitle.text = dynamicClassificationMg.name;
    self.labelExplain.text = [NSString stringWithFormat:@"已有%@人参与",dynamicClassificationMg.count];
}
@end
